Method and System for Resource Allocation

ABSTRACT

A method of allocating a resource in a computer system having a plurality of operating systems, and related system, are disclosed. In at least one embodiment, the method includes providing an advanced configuration and power interface (ACPI) operating to facilitate interactions between at least one of the plurality of the operating systems and one or more of the resource, a hardware device, and firmware, and determining whether the resource is allocated to a first of the plurality of operating systems. The method further includes ejecting the resource from the first operating system, and allocating the resource to a second of the plurality of operating systems.

CROSS-REFERENCE TO RELATED APPLICATIONS

- -

STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

- -

FIELD OF THE INVENTION

The present invention relates to computer systems and, moreparticularly, relates to methods of adding, moving, and/or otherwiseassigning and reassigning one or more computer resources within thecomputer systems.

BACKGROUND OF THE INVENTION

Many modern computer systems simultaneously perform a variety ofprocesses, each of which may have particular needs for availableresources of the computer systems. For example, many modern computersystems simultaneously run multiple operating systems, each of which mayhave particular needs for available resources. At least some suchcomputer systems employ interfaces termed advanced configuration andpower interfaces (ACPIs) that allow for multiple operating systems tointerface the hardware (and/or firmware) of the computer systems. Alsofor example, modern computer systems typically run multiple applicationssimultaneously, where each of the applications may have particular needsfor available resources.

There are many different resources of computer systems that canpotentially be allocated to different processes having needs for thoseresources. For example, most computer systems have multiple memorydevices, ranging from cache memory to main memory devices includingrandom access memory (RAM) devices (e.g., dynamic RAM or static RAMdevices) as well as other types of memory such as read only memory (ROM)devices or external memory devices. In some computer systems, not onlyspecific devices but also memory portions or locations within thevarious hardware devices also potentially are divisible and potentiallyallocable. Also for example, most computer systems have one or moreprocessing devices (e.g., central processing units (CPUs) such asmicroprocessors), and the processing power of these devices canallocated to different processes.

Often the allocation of resources to the multiple processes of suchconventional computer systems is rigidly fixed, either permanently whenthe computer systems are built or at least whenever the computer systemare turned on or rebooted. Yet this rigid allocation of resources can beundesirable, since the needs of the processes can change over timeduring their operation, such that an allocation of resources that may beappropriate and represent an efficient usage of those resources at agiven time may no longer be appropriate and efficient at a later time.

For at least these reasons, it would be advantageous if an improvedmethod and system for resource allocation could be developed by whichone or more resources available to a computer system were not so rigidlyfixed in terms of their allocation to the different processes of thecomputer system as is the case with conventional computer systems.

BRIEF SUMMARY OF THE INVENTION

The present invention in at least some embodiments relates to a methodof allocating a resource in a computer system having a plurality ofoperating systems. The method includes providing an advancedconfiguration and power interface (ACPI) operating to facilitateinteractions between at least one of the plurality of operating systemsand one or more of the resource, a hardware device, and firmware. Themethod also includes determining whether the resource is allocated to afirst of the plurality of operating systems. The method further includesejecting the resource from the first operating system; and allocatingthe resource to a second of the plurality of operating systems.

Additionally, in at least some embodiments, the present inventionrelates to a system allowing for allocating resources to a plurality ofoperating systems. The system includes a plurality of hardware devices,and firmware supported by the plurality of hardware devices. The systemadditionally includes an advanced configuration and power interface(ACPI), where the ACPI facilitates interactions between the hardwaredevices and the plurality of operating systems at least partly by way ofthe firmware. The ACPI is capable of receiving a plurality of commandsfrom the operating systems and, in response to the commands, capable ofreallocating at least one of the resources from a first of the operatingsystems to a second of the operating systems.

Further, in at least some embodiments, the present invention relates toa method of dynamically reallocating at least one resource amongoperating systems of a computer system. The method includes determiningwhether the at least one resource is currently allocated to at least oneof the operating systems, and causing the at least one resource to nolonger be allocated to the at least one operating system when it isdetermined that the at least one resource is currently allocated to theat least one operating system. The method additionally includesallocating the at least one resource to one or more operating systemsother than the at least one operating system, where the method achievesthe reallocating of the at least one resource without rebooting of thecomputer system.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows in schematic form components of a computer system inaccordance with one exemplary embodiment of the present invention; and

FIG. 2 is a flow chart showing exemplary steps of operation, which inparticular relate to the addition of resources to an operating system ofthe computer system of FIG. 1 in accordance with one embodiment of thepresent invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring to FIG. 1, components of an exemplary computer system 2 in asimplified, schematic form are shown. As shown, the computer system 2 inthe present embodiment includes multiple operating systems (OSs) 4, anadvanced configuration and power interface (ACPI) 6 and a box 8. Moreparticularly, in the present embodiment, the multiple OSs 4 include fourdifferent operating systems (or instances of the same operating system),which are shown as first, second, third and fourth operating systems 10,12, 14 and 16 respectively. Each of the OSs 10, 12, 14 and 16 includesexecutable code to perform various tasks including, for example, filemanagement, networking and resource allocation tasks, as well as tasksrelating to management of other software and hardware resources of thecomputer system 2. The OSs 10-16 are capable of supporting a widevariety of applications (not shown).

The multiple OSs 4 are intended to be representative of any of a varietyof types of operating systems as adapted in accordance with variousembodiments of the present invention. In the present embodiment, themultiple OSs 4 are HP-UX OSs as are available from the Hewlett-PackardCompany of Palo Alto, Calif. However, in other embodiments, one or moreof the OSs 10, 12, 14 and 16 can take any of a variety of other formsincluding, for example, OpenVMS, Disk Operating System (DOS), UNIX orLINUX OSs. In alternate embodiments, one or more of the OSs 4 can beanother type of OS other than those mentioned above. Additionally, whilethe multiple OSs 4 of FIG. 1 in particular include four OSs 10, 12, 14and 16, this number can vary in other embodiments from that shown, forexample, to include either one, two or three OSs or possibly more thanfour OSs as well.

With respect to the ACPI 6, this is intended to be representative of aninterface capable of facilitating communications between the multipleOSs 4 and the box 8. In the present embodiment, the ACPI 6 is an openindustry standard interface set forth in the “ADVANCED CONFIGURATION ANDPOWER INTERFACE SPECIFICATION”, Revision 3.0b (Oct. 10, 2006), which canbe found at http://www.acpi.info/spec.htm, which is hereby incorporatedby reference herein. The ACPI 6 of the present embodiment can beconsidered to be an improvement over BIOS based Advanced PowerManagement. More particularly, the ACPI 6, operating in conjunction withthe OSs 10, 12, 14 and 16, can be used to perform a variety of functionsincluding, for example, motherboard configuration, power management andresource addition for any resource/device of the computer system 2.

Further referring to FIG. 1, the box 8 includes firmware 18 and ahardware system 20. The firmware 18 is software that is closely tied tooperation of the hardware system 20, and can serve several purposes. Forexample, the firmware 18 often is used during the initialization of thecomputer system 2, to verify the configuration of the computer system 2or otherwise. Also, the firmware 18 serves as an interface (at leastindirectly, via the ACPI 6) between the hardware system 20 and the OSs 4at all times (in some embodiments, there are also direct interfacesother than ACPI that enable the OSs to interface with the firmware). Thefirmware 18 can take a variety of different forms depending upon theembodiment of the invention. For example, the firmware 18 can beembedded on read-only memory (ROM) devices such as flash memory devices,programmable ROM (PROM) devices, electrically erasable PROM (EEPROM) orany other medium that is available and used other than those alreadymentioned above.

The hardware system 20 of the present embodiment includes a memory 22 aswell as other hardware devices 24. The memory 22 can take a variety offorms depending upon the embodiment. In one embodiment of the presentinvention, the memory 22 includes a main memory formed from conventionalrandom access memory (RAM) devices such as dynamic random access memory(DRAM) devices. In alternate embodiments, the memory 22 can be formedfrom other types of memory devices, such as memory provided on floppydisk drives, tapes and hard disk drives or other storage devices thatcan be coupled to the computer system 2 of FIG. 1 either directly orindirectly (e.g., by way of a wired or wireless network). In furtherembodiments, the memory 22 can be formed from static random accessmemory (SRAM) devices such as cache memory, either as a single levelcache memory or as a multilevel cache memory having a cache hierarchy.In still other embodiments, the memory 22 can include any combination ofone or more of the above-mentioned types of memory devices, and/or otherdevices as well. The memory 22 can store all or part of the firmware 18.

In the present embodiment, the memory 22 is divided into smallersegments or chunks, shown as first, second, third and fourth memorysegments 26, 28, 30 and 32, respectively in FIG. 1. In the presentembodiment, each of the memory segments 26, 28, 30 and 32 can beassigned/allocated to any one of the different OSs 10, 12, 14 and 16.Further, although in the present embodiment the memory 22 is dividedinto four segments, the number of memory segments can vary in otherembodiments, for example, to include either one, two, or three memorysegments or possibly more than four memory segments. Notwithstanding thefact that in the present exemplary embodiment there are both four OSsand four memory segments, the number of memory segments need not be thesame as the number of OSs.

As will be described in further detail below, embodiments of the presentinvention in particular allow for dynamic reallocation of hardwareresources such as the memory segments 26, 28, 30 and 32. FIG. 1 inparticular shows two exemplary allocations of the memory segments 26,28, 30 and 32 that are possible at different times. A first of these twoallocations, represented by first arrows 34, involves allocating thememory segments 26 and 28 to the OS 10 and allocating the memorysegments 30 and 32 to the OS 12. A second of these two allocations,represented by second arrows 36, involves allocating the memory segments26, 28 and 30 to the OS 10 while the memory segment 32 is allocated tothe OS 12.

As for the other hardware devices 24 of the hardware system 20, theseare intended to include any of a variety of other types of hardwaredevices other than the memory 22 that can be present in the computersystem 2. The other hardware devices 24 can include, for example, one ormore processing devices (e.g., microprocessors, programmable logicdevices, etc.) serving as one or more central processing units (CPUs) ofthe computer system 2. Additionally, the other hardware devices 24 canalso include, for example, one or more input devices such as a keyboard,a computer mouse, a joystick or any other device used to enterinformation into the computer system 2, one or more output devices suchas a monitor, a touch-screen, a printer, a projector or any other deviceused to present information from the computer system to the user or tootherwise output information, and/or any other hardware device that canbe directly or indirectly coupled to the computer system 2 (including,for example, one or more devices for interfacing/connecting to one ormore wired or wireless networks).

The other hardware devices 24 are not shown to be segmented or allocatedin any particular manner in FIG. 1. Nevertheless, it should beunderstood that, as with respect to the memory 22, all of the otherhardware devices 24 of the computer system 2 in the present embodimentalso can be divided/allocated/assigned to the different OSs 10, 12, 14and 16. For example, the processing capabilities associated with one ormore processing devices of the other hardware devices can bedivided/allocated/assigned to the different OSs 10-16 in a variety ofmanners. Again, as further described below, in accordance withembodiments of the present invention, these other hardware devices 24(like the memory 22) can also be dynamically reallocated among thedifferent OSs 10, 12, 14 and 16.

In at least some embodiments of the present invention, including thepresent embodiment of the invention, the computer system 2 is operatedto form a virtual partitioning environment having virtual partitions.For example, the computer system 2 can be operated in accordance withthe vPars (Virtual Partitions) product available from the aforementionedHewlett-Packard Company to achieve such a virtual partitioningenvironment. When organized so as to form such an environment, thevirtual partitions of the computer system 2 can be effectively operatedas multiple “virtual” computers within the single computer system.

In such embodiment, each virtual partition is managed individually byone of the OSs 10, 12, 14 or 16 and is eligible to share (and typicallydoes share) the hardware resources of the computer system. Use of thevPars product in particular allows one to run multiple instances ofHP-UX simultaneously on one hard partition by dividing the hardpartition further into virtual partitions. Each separate HP-UX OSinstance is capable of hosting its own set of applications. Each HP-UXOS instance also can be of a different release, have different patches,and have a different kernel. Because each HP-UX OS instance is isolatedfrom all other instances, use of the vPars product provides applicationand OS fault isolation.

Potentially all of the different hardware resources of the computersystem 2, including the memory 22 as well as the other hardware devices24 (and any other hardware resources) are allocated to specific virtualpartitions managed by specific operating systems. The different virtualpartitions are isolated from each other at the software applicationlevel. Applications running on one virtual partition will not affectsoftware running on another virtual partition.

As already described above, the memory segments 26, 28, 30 and 32 areallocated to various ones of the OSs 10, 12, 14 and 16 and thusallocated to various virtual partitions. Likewise the other hardwaredevices 24 can be divided up and allocated among the various partitionsmanaged by the various OSs 10, 12, 14 and 16. Although some hardwareresources can be unused at certain times, such unallocated resourceswill still be visible to the different virtual partitions. It should beunderstood that, while often each virtual partition will be allocated atleast some of the resources (e.g., each virtual partition will have atleast one segment of the memory 22 allocated to it), this need not bethe case (e.g., as described above, in the present example the memorysegments 26, 28, 30 and 32 are allocated only to the OSs 10 and 12).

Turning to FIG. 2, at least some embodiments of the present inventionrelate to processes, such as an exemplary process 38, in which ACPImethods are used to allocate/reallocate (e.g., add, remove, assign,reassign, or otherwise transfer/migrate) resources of the computersystem 2 to and from the different OSs 10, 12, 14 and 16 of the computersystem, that is, to vary the allocation of resources among the differentvirtual partitions governed by those OSs. Unallocated resources in thecomputer system 2 which are visible to the different OSs/virtualpartitions can also be allocated or added using the ACPI methods.Generally speaking, to accomplish allocation/reallocation, the OS of avirtual partition instance that desires a particular resource typicallycalls the firmware 18 to synchronize the ownership of that resourcevis-à-vis the other OSs/virtual partitions. In contrast to conventionalmethods of resource allocation, rebooting of the computer system 2 isnot required to enable the resources to be allocated/reallocated.Rather, in accordance with these embodiments of the present invention,resource allocation/reallocation can be performed dynamically duringoperation of the computer system 2.

As already noted above, depending upon the embodiment, any one or moreof the hardware resources of the computer system 2, including the memory22 and/or any of the other hardware devices 24, can beallocated/reallocated. Nevertheless, as an example, the flow chart 38shows process steps that can be performed to cause a reallocation of amemory segment in relation to OSs (and the virtual partitions managed bythose OSs) of the computer system 2. As one example, the flow chart 38can be understood to encompass process steps that are performed to causea reallocation of the third memory segment 30 from the OS 12 to the OS10, as is illustrated by FIG. 1 (insofar as the third memory segment isshown to be linked to the second OS 12 by one of the first arrows 34 andalso shown to be subsequently linked to the first OS 10 by one of thesecond arrows 36).

As shown in FIG. 2, upon starting at a step 40, the memory segment(s) ofthe computer system 2 are allocated (or unallocated) in a particularinitial manner. For example, as shown in FIG. 1, the third memorysegment 30 can be initially assigned to/owned by the second OS 12 (e.g.,by the virtual partition affiliated with that OS). Next at a step 42,another of the OSs (in the present example, the first OS 10) determinesthat it desires reallocation of the third memory segment 30 to itself.Thus, the OS 10 invokes the ACPI 6 to commence such a reallocation. TheACPI 6 facilitates the reallocation by means of a Device Specific Method(DSM), which provides device specific control functions to devices inthe computer system 2 and is executed in response to a _DSM functioncall. For example, the _DSM method can be used to allocate a memoryresource to any of the various OSs 10, 12, 14 and 16 in the computersystem 2.

More particularly, the DSM method, which can be used to perform resourceallocation/reallocation for any device in the computer system 2, isperformed based upon four arguments, namely, a UUID (Universal UniqueIdentifier), a Revision ID, a Function Index and Arguments. The UUID isa 128 bit buffer that differentiates the various functions that can beperformed on a device in the computer system 2 using the _DSM functioncall. The Revision ID is unique to the UUID and provides a revision fora function. The Function Index is a number, the meaning of which isunique to the UUID and the Revision ID. When the Function Index is equalto 0, this is indicative of a special query function that returns abuffer specifying all the different function indices that are supportedby the computer system 2 for a specified UUID and Revision ID. When theFunction Index takes on a non-zero value, is function-specific dependingupon the UUID and Revision ID. The DSM method can be placed at anydevice level that is visible to the OS so that resources currently notvisible to the OS can also be added.

In the present example in which the OS 10 desires the memory segment 30,the OS 10 attempts to determine if the firmware 18 is capable ofperforming the migration of the memory segment 30 by calling the _DSMfunction at the step 42. The _DSM function in this example can have aspecial Function Index of 0. Then, based upon a value returned by thefirmware 18 in response to the _DSM function, the OS 10 is able todetermine in a step 44 if the firmware 18 is capable of performing thedesired memory migration.

If the value returned by the _DSM function call in the step 44 is 0,this indicates that the firmware 18 is not capable of performing thedesired memory migration (e.g., because the firmware is an earlierversion of firmware not having such capability) and consequently theprocess ends at a step 60. However, if the Function Index value returnedby the DSM function call in step 44 is 1, then this indicates that thefirmware 18 is capable of the functionality appropriate for reallocatingthe memory segment 30, and so the process proceeds to a step 46.

Upon reaching the step 46, the OS queries the firmware 18 again bymaking another function call. At this time, the purpose of querying thefirmware 18 is to obtain information regarding the current status andlocation of the resource that is of particular interest to the OS, e.g.,the memory segment 30 that is of particular interest to the OS 10. Inthe present example, two distinct function calls are made by the OS toobtain the status and ownership information, namely, a _STA method forobtaining the status information and a FPN method for obtainingownership information. Both of these methods, which are described inmore detail below, are used to identify the status/ownership informationof the memory segment 30 to be migrated from the OS 12 to the OS 10.Notwithstanding the use of the _STA and _FPN methods in the presentexample, in alternate embodiments one or more ACPI_DSM function callscan be employed instead to obtain this information.

Further with respect to the present exemplary embodiment, every resourcein the computer system 2 has a status (STA) method to determine thestatus and a F-Pars Number (FPN) method to determine the ownership ofthe resource in the computer system 2. Knowledge of the currentownership of a resource is significant since, in the present embodiment,an OS can only delete a resource that it owns. The firmware 18 willcommunicate the ownership of the memory segment 30 via the FPN method,which also is an ACPI method and is executed in response to a _FPNfunction call. The FPN method maintains the ownership of the resource interms of the OS, which manages the resource and the virtual partition towhich the resource belongs. The return value of the _FPN function callconveys the current owner of the memory segment (e.g., the memorysegment) 30 to the OS (e.g., the OS 10).

As for the STA method, this method is another ACPI method thatdetermines the status of a resource in the computer system 2, and thatis executed in response to the calling of a _STA function. In thepresent embodiment, the _STA function call is 32 bits long and does nottake any arguments like the DSM method. The different bits of thefunction call reflect the status of a device in the computer system 2.

More particularly, the status of a device can be one of the following:enabled, disabled or removed. A bit 0 of the _STA method function call,which represents the right-most or the least significant bit (LSB), isset if a given device is present in the computer system 2. A bit 1 isset if the device is enabled and decoding its hardware resources. If thebit 0 is cleared, then the bit 1 should also be cleared since a devicewhich is not present in the computer system 2 cannot be enabled.Additionally, a bit 2 of the STA method function call is set if thedevice should be shown in the user interface (not shown) associated withthe computer system 2. Further, a bit 3 is set if the device isfunctioning properly and a bit 4 is set if the device has a battery.Bits 5-31 are reserved bits which typically should be cleared. A set bitrepresents a logic level 1 in digital electronics. while a cleared bitrepresents a logic level 0.

The different bits of the STA method/function call are updated afterevery function call to reflect the outcome of the function call in thecomputer system 2. The STA method can be called at any point of timeduring the allocation/reallocation of a resource to determine thecurrent status of the resource. By looking at the return values of the_STA and _FPN function calls executed in response to the DSM method inthe step 46, the OS 10 determines the status and owner of the memorysegment 30.

In the embodiment of FIG. 1, the devices in the computer system 2 arearranged in a tree structure maintained by the firmware 18. The variousdevices in the tree structure, including the devices that may or may notbe currently assigned to a virtual partition (hence, may or may not bemanaged by the various OSs 10-16) are visible to the various OSs 10, 12,14 and 16, by means of those OSs requesting the tree structure from thefirmware 18 and further traversing the tree in the computer system 2. Bytraversing the tree, the OS 10 can also determine the location of thememory segment 30 in the tree hierarchy.

Upon determining the owner, status and location of the memory segment 30at the step 46, the process moves to a step 48 at which the OS 10determines whether the memory resource of interest has already beenallocated to an OS/virtual partition or not, based upon the response ofthe FPN and STA methods executed in the step 46. In the present exampleof FIG. 1 in which the OS 10 desires the memory segment 30, the OS 10determines that the memory segment 30 has been initially assigned to thesecond OS 12, and so the response to the _DSM ACPI method would be anindication that the memory segment 30 is currently owned by the OS 12.However, in other circumstances, the memory segment 30 (or other memorysegment or other resource) can be assigned to other virtualpartitions/OSs, or even be an unused resource that, although not ownedby any OS, is still visible to all of the OSs and capable of being addedto any OS/virtual partition in the computer system 2.

If at the step 48 the OS (e.g., the OS 10) determines that the desiredmemory resource (e.g., the memory segment 30) is not already allocated,then the process proceeds to a step 54, which is described in furtherdetail below. However, if at the step 48 the OS determines that thedesired memory resource is already allocated, then the process advancesto a step 50, at which a memory ejection operation is performed inrelation to the desired memory resource by the operating systemcurrently having ownership of the desired memory resource (otherwise, ifthe OS desiring the memory resource proceeded to request allocation ofthe resource to itself, that request would be rejected). (Also, if theoperating system currently having ownership may not eject the memoryresource, then the request would also be rejected.) In the example ofFIG. 1, the memory segment 30 is initially assigned to the second OS 12and yet the first OS 10 desires reassignment of that memory segment toitself. For that reason, in the present example, the process of FIG. 2proceeds from the step 48 to the step 50 to accomplish the freeing-up ofthe desired memory segment 30.

More particularly, to perform a memory delete operation, an ACPI ejectmethod is executed at the step 50 by means of a _EJx function call(where the “x” in _EJx represents the different sleeping statessupported by a resource and can range from 0-4). The eject method allowsfor the dynamic removal or ejection of a resource from the OS currentlyhaving ownership of the resource by making a _EJ0 function call. In thepresent example, the OS 12 (currently owning the memory segment 30)makes the _EJ0 function call at the step 50 to attempt to de-allocatethe desired memory segment 30 before the OS 10 can allocate the memorysegment 30 to itself.

Although devices are most commonly ejected by means of the _EJ0 functioncall, other eject function calls, for example, _EJ1, _EJ2, _EJ3 or _EJ4can also be used to facilitate the removal of a resource from the OSmanaging the resource. Further, while all resources in the computersystem 2 support the eject method, in other embodiments not everyresource can be ejected. In such embodiments, whether a given resourcecan be ejected is determined by the firmware 18, which only executes the_EJx function call on resources that can be ejected. Also, in somealternate embodiments, when it is determined that a memory segmentdesired by an OS is already allocated, rather than ejecting that memorysegment, the OS instead can traverse the tree structure and query thevarious memory segments which are part of the tree to find a memorysegment that is able to be allocated to the OS.

Assuming that a memory resource of interest (e.g., the memory segment30) can be ejected, the firmware 18 will execute the eject method onthat memory resource by calling the _EJ0 function and consequentlyproceed to a step 52 where the outcome of the _EJ0 function call/methodis determined. More particularly, at the step 52, a _STA function callis executed in response to the execution of the _EJ0 function call, andthe different bits of the _STA function call determine if the memory wassuccessfully ejected. In the present example in which the memory segment30 is desired by the OS 10, a bit 1 of the _STA method for that memorysegment (which was set before the _EJ0 function call to reflectownership by the OS 12) will be cleared if the _EJ0 function callsuccessfully completed ejection, indicating that the memory segment 30is no longer owned by the OS 12.

If it is determined at the step 52 that the _EJ0 method of the step 50failed to eject the memory resource of interest (e.g., the memorysegment 30), then the bit 1 will remain set, indicating that theoriginal ownership allocation of that memory resource (e.g., to the OS12) remains intact and that the memory resource cannot be ejected ormigrated. If this occurs, then the process of the flow chart 38progresses to a step 60, at which point the process ends (albeit, insome alternate embodiments, the process could then repeat the step 50 onone more occasions to reattempt ejection). However, if at the step 52 itis determined that the _EJ0 method completed successfully, the ejectedmemory resource (e.g., the segment 30) can then be allocated to the OSdesiring that resource (e.g., the OS 10), and so the process advances tothe step 54.

As discussed above, the process of the flow chart 38 is capable ofattaining the step 54 either because the desired memory resource wassuccessfully ejected as determined in the step 52 or because the desiredmemory resource was determined at the step 48 as being currently notallocated. In either case, if the process reaches the step 54, it isbecause the resource that is desired (e.g., the memory segment 30) isfree for allocation to the desirer (e.g., the OS 10). Upon reaching thestep 54, the OS desiring the memory resource then calls another DSM ACPImethod (more particularly, a _DSM function call) that is intended tocause the allocation/migration of the desired memory resource to thatOS. With respect to the example of FIG. 1 in which the OS 10 desires thememory segment 30, therefore, the DSM function call of the step 54allows the OS 10 to request the ownership of the memory segment 30 to betransferred to itself.

The ACPI methods cannot be called on devices that are not owned by anyOSs (e.g., devices that are ejected are not owned by any of the variousOSs 10, 12, 14 and 16), the ownership being determined by the FPN andSTA methods. Nevertheless, as mentioned above, all of thedevices/resources in the computer system 2 are arranged in a treestructure which is visible to the OSs, where the root of the tree is_SB_. In the present embodiment, this tree structure is utilized tofacilitate the allocation or reallocation of resources that are part ofthe tree structure but are not currently owned by any of the variousOSs, e.g., memory resources that have been ejected. More particularly,the _DSM function call executed in the step 54 is usually executed fromthe root (_SB_) of the tree rather than from individual devices.Notwithstanding that this is usually the case, the ACPI DSM method canalso be called for individual devices in the tree as long as a parentresource of the device (for which the DSM method is called) in the treehas a DSM function available. For example, in the present embodiment,the _DSM method is placed at _SB_to be able to add any memory segment inthe computer system 2. In alternate embodiments, the _DSM method can beput at a different level to allocate devices as long as it is at a levelabove the resources that are desired to be allocated. This enables theOS to allocate resources not currently allocated to the OS whichotherwise would not be possible under ACPI.

In general, the various ACPI methods of the step 54 and the otherabove-discussed steps are executed in the OSs using ACPI MachineLanguage (AML), which is the language that the ACPI interpreterunderstands. However, in at least some embodiments, the ACPI_DSMfunction call of the step 54, in addition to causing migration of amemory resource such as the memory segment 30, also moves the code forperforming the addition into the firmware 18 via an A1 OpRegion that iscapable of running ACPI Machine Language (AML) without calling any ofthe OSs. The A1 OpRegion serves as a link or hook in AML and ACPI toenable calling of non-AML code from within an ACPI function. This allowsfor the execution of normal firmware code (non-AML) to perform theaddition of the memory segment 30.

Upon performing the step 54 intended to cause the reallocation of amemory resource (e.g., the memory segment 30) to the OS desiring thatmemory resource (e.g., the first OS 10), at a step 56 it is thendetermined whether the reallocation was successfully completed. Moreparticularly, the status of the migration of the memory resource to thevirtual partition managed by the OS desiring that memory resource isdetermined by a return value of the _DSM ACPI method called in step 54.If at the step 56 it is determined that the migration was unsuccessful,then the process ends by progressing to the step 60 of the flowchart 38.However, if it is determined that the allocation of the memory resourceto the virtual partition managed by the OS desiring that memory resourcehas in fact been successful, then the process proceeds to a step 58.

Assuming that the allocation of the memory resource has beensuccessfully achieved in the step 56, this is not to say that theprocess of migrating the memory resource has in fact been completed.Rather, subsequent to the performance of the step 56, the internalstates of the STA and FPN methods are updated in step 58 to reflect thenew assignment of the memory resource to the appropriate OS/virtualpartition. Thus, in the present example in which the memory segment 30has been moved from the OS 12 to the OS 10, at the step 58 the internalstates of the STA and FPN methods are updated to reflect thistransition. Upon completion of the step 58, the process advances againto the step 60, at which the process is completed.

While the process described above with respect to the flow chart 38 ofFIG. 2 is one example of a process by which memory resources can beallocated/reallocated among the OSs/virtual partitions of a computersystem in a dynamic manner, the present invention is also intended toencompass a variety of other processes, including modifications and/orrefinements of the above-described process, allowing for resourceallocation/reallocation. The particular ACPI methods employed above tofacilitate resource addition and deletion, the steps followed tofacilitate resource addition for a device in the computer system andother features could all be varied depending upon the type/needs of thecomputer system being used and the device being added.

Also, as already noted above, the present invention is intended toencompass processes in which not merely memory but also other hardwareresources (and even firmware, or other resources) are moved amongvirtual partitions managed by different OSs (or possibly otherprocesses). In alternate embodiments, resource addition, allocation,and/or reallocation in accordance with embodiments of the presentinvention can be performed in environments other than a virtualpartition environment, both where unused resources are added to an OS aswell as where resources are moved between different OSs.

It is specifically intended that the present invention not be limited tothe embodiments and illustrations presented herein, but include modifiedforms of those embodiments including combinations of elements ofdifferent embodiments or portions of the embodiments that come withinthe scope of the following claims.

1. A method of allocating a resource in a computer system having aplurality of operating systems, the method comprising: providing anadvanced configuration and power interface (ACPI) operating tofacilitate interactions between at least one of the plurality ofoperating systems and one or more of the resource, a hardware device,and firmware; determining whether the resource is allocated to a firstof the plurality of operating systems; ejecting the resource from thefirst operating system; and allocating the resource to a second of theplurality of operating systems.
 2. The method of claim 1, wherein theejecting of the resource occurs if it is determined that the resource isallocated to the first operating system.
 3. The method of claim 1,wherein the determining, ejecting and allocating occur in response torespective commands being provided to the ACPI, and wherein the ejectingand allocating of the resource constitutes a reallocation of theresource from the first operating system to the second operating system.4. The method of claim 3, wherein the commands are all provided to theACPI by either the first operating system or the second operatingsystem.
 5. The method of claim 1, further comprising: requestinginformation concerning at least one of a status, an owner and a locationof the resource.
 6. The method of claim 1, further comprising one ormore of: determining whether the firmware of the computer system iscapable of carrying out a requested operation to determine at least oneof status information concerning the resource and ownership informationof the resource; determining whether the ejecting of the resource wassuccessful; and determining whether the allocating of the resource wassuccessful.
 7. The method of claim 1, wherein the interactionsfacilitated by the ACPI occur between at least one of the first or thesecond operating systems and either the resource or the hardware deviceby way of the firmware.
 8. The method of claim 1, wherein each of thefirst and second operating systems is a respective operating systeminstance booted on hardware, and wherein each of the respectiveoperating system instances manages a respective virtual partition of thecomputer system.
 9. The method of claim 8, wherein the computer systemoperates in accordance with a vPars product.
 10. The method of claim 1,wherein the resource includes or is supported by the hardware device,and wherein the resource includes one or more of (i) a memory segment;(ii) a processing capability; and (iii) an input/output capability. 11.The method of claim 10, wherein the resource includes the memorysegment, and wherein the memory segment is selected from the groupconsisting of cache memory, main memory, and random access memory (RAM).12. The method of claim 1, wherein the determining, the ejecting and theallocating all occur dynamically during normal operation of the computersystem subsequent to a booting up of the computer system.
 13. A systemallowing for allocating resources to a plurality of operating systems,the system comprising: a plurality of hardware devices; firmwaresupported by the plurality of hardware devices; and an advancedconfiguration and power interface (ACPI), wherein the ACPI facilitatesinteractions between the hardware devices and the plurality of theoperating systems at least partly by way of the firmware, wherein theACPI is capable of receiving a plurality of commands from the pluralityof the operating systems and, in response to the commands, capable ofreallocating at least one of the resources from a first of the operatingsystems to a second of the operating systems.
 14. The system of claim13, wherein the plurality of operating systems respectively manage aplurality of virtual partitions.
 15. The system of claim 13, wherein thehardware resources include at least one of means for storing informationand means for processing information.
 16. The system of claim 13,wherein the commands include at least one of a first command to performa device specific method (DSM), a second command to perform a status(STA) method, a third command to perform a F-Pars Number (FPN) method,and a fourth command to perform an eject _EJx) method.
 17. The system ofclaim 13, wherein at least some of the devices and resources of thesystem are arranged in a tree structure that is visible to the operatingsystems.
 18. A method of dynamically reallocating at least one resourceamong operating systems of a computer system, the method comprising:determining whether the at least one resource is currently allocated toat least one of the operating systems; causing the at least one resourceto no longer be allocated to the at least one operating system when itis determined that the at least one resource is currently allocated tothe at least one operating system; and allocating the at least oneresource to one or more operating systems other than the at least oneoperating system, wherein the method achieves the reallocating of the atleast one resource without rebooting of the computer system.
 19. Themethod of claim 18, wherein each of the determining, the causing, andthe allocating occurs in response to a respective message provided fromthe one or more operating systems to an advanced configuration and powerinterface (ACPI).
 20. The method of claim 18, wherein it is determinedthat the current allocating of the at least one resource involves eithera first allocation to a first virtual partition of the computer systemor a null allocation in which the at least one resource is not allocatedto any virtual partition of the computer system, and wherein the atleast one resource includes a memory segment.